{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 梯度下降算法模拟"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "plot_x = np.linspace(-1, 6, 141)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-1.  , -0.95, -0.9 , -0.85, -0.8 , -0.75, -0.7 , -0.65, -0.6 ,\n",
       "       -0.55, -0.5 , -0.45, -0.4 , -0.35, -0.3 , -0.25, -0.2 , -0.15,\n",
       "       -0.1 , -0.05,  0.  ,  0.05,  0.1 ,  0.15,  0.2 ,  0.25,  0.3 ,\n",
       "        0.35,  0.4 ,  0.45,  0.5 ,  0.55,  0.6 ,  0.65,  0.7 ,  0.75,\n",
       "        0.8 ,  0.85,  0.9 ,  0.95,  1.  ,  1.05,  1.1 ,  1.15,  1.2 ,\n",
       "        1.25,  1.3 ,  1.35,  1.4 ,  1.45,  1.5 ,  1.55,  1.6 ,  1.65,\n",
       "        1.7 ,  1.75,  1.8 ,  1.85,  1.9 ,  1.95,  2.  ,  2.05,  2.1 ,\n",
       "        2.15,  2.2 ,  2.25,  2.3 ,  2.35,  2.4 ,  2.45,  2.5 ,  2.55,\n",
       "        2.6 ,  2.65,  2.7 ,  2.75,  2.8 ,  2.85,  2.9 ,  2.95,  3.  ,\n",
       "        3.05,  3.1 ,  3.15,  3.2 ,  3.25,  3.3 ,  3.35,  3.4 ,  3.45,\n",
       "        3.5 ,  3.55,  3.6 ,  3.65,  3.7 ,  3.75,  3.8 ,  3.85,  3.9 ,\n",
       "        3.95,  4.  ,  4.05,  4.1 ,  4.15,  4.2 ,  4.25,  4.3 ,  4.35,\n",
       "        4.4 ,  4.45,  4.5 ,  4.55,  4.6 ,  4.65,  4.7 ,  4.75,  4.8 ,\n",
       "        4.85,  4.9 ,  4.95,  5.  ,  5.05,  5.1 ,  5.15,  5.2 ,  5.25,\n",
       "        5.3 ,  5.35,  5.4 ,  5.45,  5.5 ,  5.55,  5.6 ,  5.65,  5.7 ,\n",
       "        5.75,  5.8 ,  5.85,  5.9 ,  5.95,  6.  ])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "plot_x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "plot_y = (plot_x - 2.5) ** 2 - 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3Xl4ldW5/vHvkzmBJBAykJAREmYIYGRWQVAUUNRaxalqnap1qD+rx9r2dNaetp462zpTRVAQFRVHREVkCiBjAoSQOSQhQBIy7531+4PgoZY5O1l7eD7XlYskbnhvQrxZrLXe9YoxBqWUUp7Pz3YApZRSrqGFrpRSXkILXSmlvIQWulJKeQktdKWU8hJa6Eop5SW00JVSyktooSullJfQQldKKS8R0JUXi46ONqmpqV15SaWU8njr1q3ba4yJOdHrurTQU1NTyc7O7spLKqWUxxORwpN5nU65KKWUl9BCV0opL6GFrpRSXkILXSmlvIQWulJKeQktdKWU8hJa6Eop5SU8otA/2FTO3NUntQ1TKaXcSumBRv78YS6VdU2dfi2PKPQlm8v528fbaXY4bUdRSqlT8sbaYv751S5aHG2dfi2PKPQrz0xif0MrH2+tsB1FKaVOmrPNsCC7mLMyYkjsGdbp1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4jSXcUDy0RkE4f+ov/UGOP22wE9RBzwtYhsBNYAHxhjPrKc6XjuAua2fy+MAB7urAvpnaJKKeUlPGqErpRS6ti00JVSyktooSullJfQQldKKS+hha6UUl5CC10ppbyEFrpSSnkJLXSllPIS/x+DZnALDR7YeQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1054bb8d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(plot_x, plot_y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def dJ(theta):\n",
    "    return 2 * (theta - 2.5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def J(theta):\n",
    "    return (theta - 2.5) ** 2 - 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "eta = 0.1\n",
    "epsilon = 1e-8\n",
    "theta = 0.0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "while True:\n",
    "    gradient = dJ(theta)\n",
    "    last_theta = theta\n",
    "    theta = theta - eta * gradient\n",
    "    \n",
    "    if (np.abs(J(theta) - J(last_theta)) < epsilon):\n",
    "        break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.499891109642585"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "theta"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.99999998814289"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "J(theta)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "theta = 0\n",
    "theta_history = [theta]\n",
    "while True:\n",
    "    gradient = dJ(theta)\n",
    "    last_theta = theta\n",
    "    theta = theta - eta * gradient\n",
    "    theta_history.append(theta)\n",
    "    if (np.abs(J(theta) - J(last_theta)) < epsilon):\n",
    "        break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3Xd0lVX69vHvnR4gCSUJpEFC7yAGCEUFRLEg1lFQVCygYxmZcfTFaURnRudnmbFXRBlBQRAVFRVFkCIIoUkJNZAKIQRIIaTv948EB5ESOCfZp9yftbLSDjyXGC+2e+9nP2KMQSmllPvzsR1AKaWUc2ihK6WUh9BCV0opD6GFrpRSHkILXSmlPIQWulJKeQgtdKWU8hBa6Eop5SG00JVSykP4NeTFwsPDTXx8fENeUiml3N6aNWsOGGMizvS6Bi30+Ph4UlJSGvKSSinl9kQkvS6v0ykXpZTyEFroSinlIbTQlVLKQ2ihK6WUh9BCV0opD6GFrpRSHkILXSmlPIRbFPoXP+1lxo912oaplFIuJfvwUf715Vb2F5XW+7XcotDnb9zLs19vo6yyynYUpZQ6K7NWZ/LGkl2UV1bX+7XcotBv6hvHoZIKvt6cazuKUkrVWVW1YXZKJhd0iCC2WaN6v55bFPrg9uHENgtm1uoM21GUUqrOlmzPY29BKWP6xjXI9dyi0H18hJsS41i+M5/0/CO24yilVJ18sCqD8CYBXNylZYNczy0KHeCGxFh8pGY+SimlXN3+wlIWbt3P9X1iCfBrmKp1m0KPCgtmaKdIZq/JorKq/hcXlFLKEXP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SJaI3GU702kMAm4FhtVuVVtfO6J0VVHAIhH5iZq/6L8xxrj8dkA30RJYJiIbgFXAF8aYryxnOp0HgRm1Pwu9gSfr60J6p6hSSnkItxqhK6WUOjUtdKWU8hBa6Eop5SG00JVSykNooSullIfQQldKKQ+hha6UUh5CC10ppTzE/wdJFkGExEMQDAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x108301978>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(plot_x, J(plot_x))\n",
    "plt.plot(np.array(theta_history), J(np.array(theta_history)), color = 'r', marker = '+')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "def gradient_descent(initial_theta, eta, epsilon = 1e-8, n_iters = 1e4):\n",
    "    theta = initial_theta\n",
    "    theta_history = [initial_theta]\n",
    "    \n",
    "    while True:\n",
    "        gradient = dJ(theta)\n",
    "        last_theta = theta\n",
    "        theta = theta - eta * gradient\n",
    "        theta_history.append(theta)\n",
    "        \n",
    "        if (np.abs(J(theta) - J(last_theta)) < epsilon):\n",
    "            break\n",
    "        \n",
    "def plot_theta_history():\n",
    "    plt.plot(plot_x, J(plot_x))\n",
    "    plt.plot(np.array(theta_history), J(np.array(theta_history)), color = 'r', marker = '+')\n",
    "    plt.show()\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3Xl4ldW5/vHvkzmBJBAykJAREmYIYGRWQVAUUNRaxalqnap1qD+rx9r2d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OI0xI4BEYLSIDLWd6WhEZCZQaYxZZzvLKZhgjBnFoenNn4rI2bYDHUMAMAp41hgzEqgHOm1tze0eEm2MmWo7QweUAElHfJwIlFnK4nVEJJBDZT7XGLPIdp6TZYw5ICJfcGi9wh0XoCcAF4vIdCAEiBCR14wx11rOdUzGmLL2HytF5G0OTXe649paCVByxL/OFtKJhe52I3QPtxbIEJE0EQkCZgOLLWfyCiIiHJqHzDHG/K/tPCciIjEi0qP9/VBgKpBrN9XRGWN+YYxJNMakcuh79nN3LnMR6SYi4YffB87HPf+ixBizBygWkQHtn5oCbOus63lUoYvIpSJSAowDPhCRj21nOpIxxgHcCXzMoUW7N40xW+2mOjYRmQesBAaISImI3GQ703FMAK4Dzm3fqvZt+4jSXcUDy0RkE4f+ov/UGOP22wE9RBzwtYhsBNYAHxhjPrKc6XjuAua2fy+MAB7urAvpnaJKKeUlPGqErpRS6ti00JVSyktooSullJfQQldKKS+hha6UUl5CC10ppbyEFrpSSnkJLXSllPIS/x+DZnALDR7YeQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1083ae358>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "eta = 0.01\n",
    "theta_history = []\n",
    "gradient_descent(0., eta)\n",
    "plot_theta_history()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(theta_history)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
